home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / asm56.zoo / a56.h next >
C/C++ Source or Header  |  1992-11-14  |  2KB  |  89 lines

  1. /*******************************************************
  2.  *
  3.  *  a56 - a DSP56001 assembler
  4.  *
  5.  *  Written by Quinn C. Jensen
  6.  *  July 1990
  7.  *  jensenq@npd.novell.com (or jensenq@qcj.icon.com)
  8.  *
  9.  *******************************************************\
  10.  
  11. /*
  12.  * Copyright (C) 1990-1992 Quinn C. Jensen
  13.  *
  14.  * Permission to use, copy, modify, distribute, and sell this software
  15.  * and its documentation for any purpose is hereby granted without fee,
  16.  * provided that the above copyright notice appear in all copies and
  17.  * that both that copyright notice and this permission notice appear
  18.  * in supporting documentation.  The author makes no representations
  19.  * about the suitability of this software for any purpose.  It is
  20.  * provided "as is" without express or implied warranty.
  21.  *
  22.  */
  23.  
  24. /*
  25.  *  a56.h - general definitions
  26.  *
  27.  */
  28.  
  29. #include <stdio.h>
  30.  
  31. #ifndef TRUE
  32. #define TRUE 1
  33. #define FALSE 0
  34. #define NOT !
  35. typedef int BOOL;
  36. #endif
  37.  
  38. struct sym {
  39.     char *name;
  40.     struct n {
  41.     int type;
  42. #define UNDEF -1
  43. #define INT 0
  44. #define FLT 1
  45.     union val {
  46.         int i;
  47.         double f;
  48.         } val;
  49.     } n;
  50.     struct sym *next;
  51. } *find_sym();
  52.  
  53. extern int pass;
  54.  
  55. #define NEW(object) ((object *)alloc(sizeof(object)))
  56.  
  57. #define PROG 0
  58. #define XDATA 1
  59. #define YDATA 2
  60. #define LDATA 3
  61.  
  62. #define MAX_NEST 20    /* maximum include file nesting */
  63.  
  64. struct inc {
  65.     char *file;
  66.     FILE *fp;
  67.     int line;
  68. };
  69. extern struct inc inc[];
  70. extern int inc_p;
  71. #define curfile inc[inc_p].file
  72. #define curline inc[inc_p].line
  73.  
  74. struct psect {
  75.     char *name;
  76.     int seg;
  77.     unsigned int pc, bottom, top;
  78.     struct psect *next;
  79. } *find_psect(), *new_psect();
  80.  
  81. FILE *open_read(), *open_write(), *open_append();
  82.  
  83.     /* save string s somewhere */
  84. #define strsave(s) ((s) != NULL ? \
  85.     (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
  86.  
  87.     /* after a call to fgets(), remove the newline character */
  88. #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
  89.